import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({

  routes: [
    {path: '/', redirect: '/login'},
    {
      path: '/home',
      component: resolve => require(['src/components/common/HomeView.vue'], resolve),
      children: [
        {path: '/', component: resolve => require(['src/views/homePage.vue'], resolve)},
        //修改密码
        {path: '/modifyPassword', component: resolve => require(['src/views/user/ModifyPassword.vue'], resolve)},
        {path: '/editorArticle', component: resolve => require(['src/views/editorArticle.vue'], resolve)},
        {path: '/articleList', component: resolve => require(['src/views/articleManage/articleList.vue'], resolve)},
      ]
    },
    {path: '/login', component: resolve => require(['src/views/user/Login.vue'], resolve)},
    {path: '/register', component: resolve => require(['src/views/user/Register.vue'], resolve)},
    {path:'/lookArticle/:id', component: resolve => require(['src/views/articleManage/lookArticle.vue'], resolve)},
    {path: '/test', component: resolve => require(['src/views/test/test.vue'], resolve)}
  ]
  // routes: [
  //   {
  //     path: '/',
  //     name: 'home',
  //     component: Home
  //   },
  //   {
  //     path: '/about',
  //     name: 'about',
  //     // route level code-splitting
  //     // this generates a separate chunk (about.[hash].js) for this route
  //     // which is lazy-loaded when the route is visited.
  //     component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
  //   }
  // ]
})
